package com.example.design.generic.test03;

import java.util.HashMap;

/**
 * @Description TODO
 * @date 2022/9/19 9:25
 * @Author liuzhihui
 * @Version 1.0
 */
public class Test03 {
    public static void main(String[] args) {

        User user1 = new User(1,12,"张三");
        User user2 = new User(2,23,"王五");
        User user3 = new User(3,34,"李四");
        User user4 = new User(4,21,"赵六");

        DAO<User> dao= new DAO<>(new HashMap<>());
        dao.save("1",user1);
        dao.save("2",user2);
        dao.save("3",user3);
        System.out.println(dao.get("3"));
        dao.update("3",user4);
        System.out.println(dao.list());
        dao.delete("1");
        System.out.println(dao.list());
    }
}
